#include<stdio.h>
#include<string.h>
int a[27];
bool is_prim(int x) {
	int i;
	for (i = 2; i * i <= x; i++)
		if (!(x % i))
			return false;
	return true;
}
int main() {
	int i, j, T;
	int len, max, min;
	char str[100];
	scanf("%d%*c", &T);
	while (T--) {
		max = 0;
		min = 100;
		memset(a, 0, sizeof(a));
		scanf("%s", str);
		len = strlen(str);
		for (i = 0; i < len; i++)
			++a[str[i] - 'a' + 1];
		for (i = 1; i <= 26; i++)
			if (a[i]) {
				if (max < a[i])
					max = a[i];
				if (min > a[i])
					min = a[i];
			}
		if (is_prim(max - min) && (max - min) && (max - min) != 1)
			printf("Lucky Word\n%d\n", max - min);
		else
			printf("No Answer\n%d\n", 0);
	}
	return 0;
}
